package models

import "gorm.io/gorm"

// 用户
type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(50)"`
	Password string `gorm:"type:varchar(50)"`
}

// 角色
type Role struct {
	gorm.Model
	RoleName string `gorm:"type:varchar(50)"`
}

// 权限
type Node struct {
	gorm.Model
	NodeName string `gorm:"type:varchar(50)"`
}

// 用户角色表
type UserRole struct {
	gorm.Model
	Uid int `gorm:"type:int(11)"`
	Rid int `gorm:"type:int(11)"`
}

// 角色权限内表
type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int(11)"`
	Nid int `gorm:"type:int(11)"`
}

// 车辆
type Car struct {
	gorm.Model
	CarCode string `gorm:"type:varchar(50)"`
	CarName string `gorm:"type:varchar(50)"`
	CarNum  string `gorm:"type:varchar(50)"`
}

// 车辆订单表
type Order struct {
	gorm.Model
	OrderCode   string `gorm:"type:varchar(50)"` //编号
	FromAddress string `gorm:"type:varchar(50)"` //发货地
	ToAddress   string `gorm:"type:varchar(50)"` //目的地
	Cid         int    `gorm:"type:int(11)"`     //车辆id
}

// 列表
type OrderList struct {
	OrderId     int    `gorm:"type:int(11)"`
	CarCode     string `gorm:"type:varchar(50)"`
	CarName     string `gorm:"type:varchar(50)"`
	CarNum      string `gorm:"type:varchar(50)"`
	OrderCode   string `gorm:"type:varchar(50)"` //编号
	FromAddress string `gorm:"type:varchar(50)"` //发货地
	ToAddress   string `gorm:"type:varchar(50)"` //目的地
}
